/**
 ***********************************************************************************************************
 * 
 ***********************************************************************************************************
 * @file RBTexture.h
 ***********************************************************************************************************/

#ifndef __RBTEXTURE_H__
#define __RBTEXTURE_H__

#ifdef  HEADER_ONCE
#pragma HEADER_ONCE
#endif

#ifdef  HEADER_MSG
#pragma HEADER_MSG(RBTexture.h)
#endif

/***********************************************************************************************************
 * Includes
 ***********************************************************************************************************/
#include "RBHardwareBuffer.h"
#include "RBPixelBuffer.h"
#include "RBPixelFormat.h"
#include "RBStream.h"

/***********************************************************************************************************
 * Forward declarations
 ***********************************************************************************************************/
class RBPixelBuffer;

/***********************************************************************************************************
 * Classes
 ***********************************************************************************************************/

class RBTexture : public RBHardwareBuffer
{
    RBDeclareRTTI(RBTexture, RBHardwareBuffer);
    RBDeclareHBSerializable(RBTexture);
public:
                    RBTexture       (uint32 uiTextureUsage, uint32 uiMemPoolMask, RBHardwareBufferManager* pCreator, void* pNative,
                                     RBPixelFormat eFormat, RBTextureType::EType eType, uint32 uiWidth, uint32 uiHeight, uint32 uiMips, 
                                     uint32 uiDepth, uint32 uiFaceCount);
    virtual		   ~RBTexture		();

    RBTextureType::EType	GetType         () const { return m_eType; }

    uint32			GetWidth        () const { return m_uiWidth; }
    uint32			GetHeight       () const { return m_uiHeight; }
    uint32			GetDepth        () const { return m_uiDepth; }
	uint32			GetFaceCount	() const { return m_uiFaceCount; }
    uint32          GetMipCount     () const { return m_uiMipCount;}

    RBPixelFormat   GetFormat       () const { return m_ePixelFormat; }

protected:
protected:
    uint32                  GetBufferIndex      (uint32 uiMip, uint32 uiFace) const { return uiMip * m_uiFaceCount + uiFace; }

protected:

    RBTextureType::EType m_eType;
    uint32              m_uiWidth;
    uint32              m_uiHeight;
    uint32              m_uiDepth;
	uint32		        m_uiFaceCount;
    uint32              m_uiMipCount;
    RBPixelFormat       m_ePixelFormat;
};

RBDeclareSmartPointer(RBTexture);

/***********************************************************************************************************/

#endif // __RBTEXTURE_H__